from openai import OpenAI

openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8000/v1"

client = OpenAI(
    api_key=openai_api_key,
    base_url=openai_api_base,
)

prompt = "在单词\"strawberry\"中，总共有几个R？"
messages = [
    {"role": "user", "content": prompt}
]

response = client.chat.completions.create(
    model="Qwen3-4B",
    messages=messages,
    # extra_body={
    #     "chat_template_kwargs": {
    #         "enable_thinking": False # 是否启用"思考"模式，开启后模型会输出<|thinking|>标签内的思考内容
    #     }
    # }
)

print(response.choices[0].message.content)